﻿using System.Linq;
using MongoDB.Driver;

namespace eCommMongo.Core.Data
{
    /// <summary>
    /// Repository
    /// </summary>
    public partial interface IMongoRepository<T> where T : BaseMongoEntity
    {
        T GetById(string id);
        string Insert(T entity);
        void Update( string id, IMongoUpdate update);
        void Update(IMongoQuery query, IMongoUpdate update);

        void Save( T entity);
        void Delete(string id);
        IQueryable<T> Table();
        IQueryable<T> Table(IMongoQuery query);
    }
}
